package com.zhentao.controller;

import com.zhentao.model.user.dto.LoginDto;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.user.pojo.ApUser;
import com.zhentao.service.ApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "app用户端登录功能",description = "手机登录")
@RestController
@RequestMapping("/api/v1/login")
@Slf4j
public class ApUserController {
    @Autowired
    private ApUserService apUserService;
    @ApiOperation("登录方法")
    @PostMapping("/login_auth")
    public ResponseResult login(@RequestBody LoginDto loginDto){
        log.info("用户登录,{},{},{}","参数1","参数2","参数3");
        log.info("用户登录,{},{},{}","参数a","参数b","参数cc");
        return apUserService.login(loginDto);
    }

    @GetMapping("test")
    public String test(){
        return "test测试";
    }

    @PostMapping("/sava_auth")
    public ResponseResult sava(@RequestBody ApUser user){
        return apUserService.sava(user);
    }
}
